package lesson3.example5;

interface Greeting {
	void sayHello(String name);
}

// JDK 给我们提供的动态代理只能代理接口，而不能代理没有接口的类
class GreetingImpl implements Greeting {
	@Override
	public void sayHello(String name) {
		System.out.println("Hello! " + name);
	}
}

public class Client {
	public static void main(String[] args) {
		Greeting greeting = new JDKDynamicProxy(new GreetingImpl()).getProxy();
		greeting.sayHello("Jack");
	}
}